// 导入vue这个包
import Vue from 'vue';

// 导入App.vue文件
import App from './App.vue';

//将vue-router集成到这个项目中来
import vueRouter from 'vue-router';
Vue.use(vueRouter);

import home from '../components/Home.vue';
import shopcar from '../components/shopcar/car.vue';
import anchorlist from '../components/anchor/anchorlist.vue';
import anchorinfo from '../components/anchor/anchorinfo.vue'
//定义路由规则
var router = new vueRouter({
    linkActiveClass: 'mui-active',
    routes:[
        {path:'/',component:home},
        {path:'/home',component:home},
        {path:'/shopcar',component:shopcar},
        {path:'/anchor/anchorlist',component:anchorlist},
        {path:'/anchor/anchorinfo/:id',component:anchorinfo},
    ],
});

//引用mint-ui组件
import 'mint-ui/lib/style.min.css'
import mintui from 'mint-ui';
Vue.use(mintui);

//引用mui中的样式
import '../../statics/mui/css/mui.css';

//引用自己的样式
import '../../statics/css/site.css';

//将vue-source在vue中绑定，并使用
import vueResource from 'vue-resource';
Vue.use(vueResource);

//定义一个全局的时间处理器
import moment from 'moment';
Vue.filter('dateformat',function(input,fmtsrting){
    return moment(input).format(fmtsrting);
})

//利用Vue对象进行解析渲染
new Vue({
    el: '#app',
    router,
    render:create=>create(App)
});